package BanyuanClub.Study.Day0224.TextDate;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class T$Date {
    public static void main(String[] args) throws ParseException {
        Date D = new Date();
        System.out.println(D);
        System.out.println(D.getTime());
        System.out.println(System.currentTimeMillis());

        //日期格式化
        SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        //format 日期->字符串
        String s = sd.format(D);
        System.out.println(s);
        //parse 字符串->日期
        String s1 = "1991-11-11 11:11:11";
        Date d = sd.parse(s1);
    }
}
